<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>

<html>
    <head>
        <title>Add User</title>
        <style>
            form label {
                float: left;
                width: 100px;
                text-align: left;
                position: relative;
                top: 2px;
                margin-right: 5px;
            }

        </style>
    </head>
    <body>

    <p align="right">
        Admin
        <c:out value = "${sessionScope.lastName}" />
        ( <a href="login.jsp">Logout</a>)
    </p>

    <h1>Add new user</h1>

         <form method="POST" action="AddUser">
             <div>
             <label>Login: </label><input type="text" name="login" required> </p>
             <label>Password: </label><input type="password" name="password" required> </p>
             <label>Password again: </label><input type="password" name="passwordagain" required> </p>
             <label>E-mail: </label><input type="email" name="email" required> </p>
             <label>First name: </label><input type="text" name="firstname" required> </p>
             <label>Last name: </label><input type="text" name="lastname"required> </p>
             <label>Birthday: </label><input type="text" name="birth" required> &nbsp format: yyyy-MM-dd </p>
             <label>Role:</label><select name="role">
                 <option value="User">User</option>
                 <option value="Admin">Admin</option>
             </select></p>
             <input type="submit" value="Ok" onclick="AddUser" />
             <input  type="button" value="Cancel" onclick="javascript:history.back()" />
             </div>
         </form>
        </td>
    </table>
    </center>
    </body>

    <p align="center"><span style="color: red"><%
        if ((request.getAttribute("error"))!= null) {
            out.println(request.getAttribute("error"));
        }
    %> </span>
    </p>


</html>